package top.jle.jpa.basic.dao;

import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Root;
import org.hibernate.query.criteria.HibernateCriteriaBuilder;

import java.io.Serializable;

/**
 * Filter 接口类
 * 
 * @author jim
 *
 */
public sealed interface PreFilter extends Serializable permits AndPreFilter, NotPreFilter, OrPreFilter, PropertyFilter,JSONPropertyFilter {
		
	
	/**
	 * 构建Criterion,必要时会在DetachedCriteria中创建假名,或利用DetachedCriteria获得实体类的类型
	 * 
	 */
	<T> Predicate buildCriterion(Root<T> root, HibernateCriteriaBuilder builder);
	
}
